package
{
	import flash.display.*;
	import flash.events.Event;
	
	import starling.core.Starling;
	
	[SWF(width="640", height="480", backgroundColor="#00")]
	public class Main extends Sprite
	{
		public function Main()
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null) : void
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;
			
			var starling:Starling = new Starling(GameEngine, stage);
			starling.showStats = true;
			starling.start();
		}
	}
}